Skip to content

Comments

feat: adds support for OpenAPI 3.2.0#65415

Merged
halter73 merged 9 commits intodotnet:mainfrom
baywet:feat/oai-3-2-0
Feb 19, 2026
Merged

feat: adds support for OpenAPI 3.2.0#65415
halter73 merged 9 commits intodotnet:mainfrom
baywet:feat/oai-3-2-0

Conversation

@baywet
Copy link
Contributor

@baywet baywet commented Feb 13, 2026

fixes #63754
a subsequent pull request(s) will be required to take advantage of the new capabilities like item schema for streaming events

@baywet baywet requested a review from a team as a code owner February 13, 2026 02:43
Copilot AI review requested due to automatic review settings February 13, 2026 02:43
@baywet baywet requested review from a team and wtgodbe as code owners February 13, 2026 02:43
@github-actions github-actions bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Feb 13, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 13, 2026
@baywet baywet mentioned this pull request Feb 13, 2026
1 task
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds support for OpenAPI 3.2.0 by upgrading the Microsoft.OpenApi NuGet packages from version 2.0.0 to 3.3.1 and updating the default OpenAPI specification version from 3.1 to 3.2. The PR makes necessary code adaptations to work with the upgraded library's API changes.

Changes:

  • Upgrades Microsoft.OpenApi and Microsoft.OpenApi.YamlReader packages from 2.0.0 to 3.3.1
  • Changes default OpenAPI specification version from OpenApi3_1 to OpenApi3_2
  • Adapts code to API changes in the library (Dictionary<string, OpenApiMediaType> → Dictionary<string, IOpenApiMediaType>)

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eng/Versions.props Updates Microsoft.OpenApi package versions from 2.0.0 to 3.3.1
src/OpenApi/src/Services/OpenApiOptions.cs Changes default OpenAPI version from OpenApi3_1 to OpenApi3_2
src/OpenApi/src/Services/OpenApiGenerator.cs Adapts to library API change for Content dictionary types
src/OpenApi/src/Services/OpenApiDocumentService.cs Adapts to library API change for Content dictionary types
src/OpenApi/gen/XmlCommentGenerator.Emitter.cs Adds .OfType() filtering when iterating Content values
src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs Updates default fallback version to OpenApi3_2
src/Tools/GetDocumentInsider/tests/GetDocumentTests.cs Updates test assertions to expect OpenApi3_2
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Transformers/CustomSchemaTransformerTests.cs Adapts test setup to use IOpenApiMediaType dictionary type
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Extensions/OpenApiEndpointRouteBuilderExtensionsTests.cs Updates version string assertions from "3.1.1" to "3.1.2"
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.SourceGenerators.Tests/snapshots/*.cs Updates generated code to use .OfType() pattern
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_1/*.txt Updates version string from "3.1.1" to "3.1.2" in snapshots
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApi3_0/OpenApiDocumentIntegrationTests.VerifyOpenApiDocument_documentName=schemas-by-ref.verified.txt Updates nullable schema structure from library changes
src/OpenApi/test/Microsoft.AspNetCore.OpenApi.Tests/Integration/snapshots/OpenApiDocumentLocalizationTests.VerifyOpenApiDocumentIsInvariant.verified.txt Updates version from "3.1.1" to "3.2.0" for default version

@baywet baywet requested a review from Copilot February 13, 2026 16:01
@martincostello martincostello added feature-openapi area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc and removed needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically labels Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 35 out of 35 changed files in this pull request and generated 2 comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated no new comments.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 34 out of 34 changed files in this pull request and generated no new comments.

@martincostello
Copy link
Member

Is the plan to release a preview Swashbuckle.AspNetCore package with support for Microsoft.OpenApi 3.3.1?

For .NET 10 we just had PR builds with prereleases available in MyGet, rather than pushing them to NuGet.org as "official" previews. My aim was to keep the long-lived PR up-to-date as the .NET 11 previews land.

@halter73
Copy link
Member

is the only reason why nuget does not complain because aspnet.openapi 10 does not have an upper bound for microsoft.openapi?
If so, could we add one to limit the confusion?

Possibly. I'm normally against upper bounds, because it could be that in certain scenarios, the breakages are irrelevant to the application, but you prevent the developer from upgrading a dependency without scary suppressions. However, if we know for a fact that it's impossible for any application that uses aspnet.openapi 10 to work with microsoft.openapi >= 3, we can consider it.

We wouldn't be able to do that for packages we've already released though. We'd be counting on people updating to the latest 10.x patch before upgrading to 11.

@halter73
Copy link
Member

@baywet It looks like some of the Microsoft.AspNetCore.OpenApi.Tests are failing on the CI. Can you look into them? We might just need to regenerate baselines again.

@Frulfump
Copy link

On second thought, given that the major versions of the Swashbuckle.AspNetCore packages align with the supported ASP.NET Core versions, maybe a new package name is overkill. Hopefully, not too many people will try to use Swashbuckle.AspNetCore 11 with ASP.NET Core 10, but I'm not sure. I certainly wouldn't blame people for thinking it might be okay especially when NuGet does not complain.

I thought that the version alignment was sort of a happy coincidence. It would keep Swashbuckle from introducing breaking changes in of-cycle releases if it needs to be continually aligned with ASP.NET Core?

@martincostello
Copy link
Member

It is a coincidence, yes.

@baywet
Copy link
Contributor Author

baywet commented Feb 17, 2026

@baywet It looks like some of the Microsoft.AspNetCore.OpenApi.Tests are failing on the CI. Can you look into them? We might just need to regenerate baselines again.

@halter73 I had forgotten one of the files while reverting the default version the other day. We should be good now!

@halter73
Copy link
Member

The latest CI run still has a failure in the VerifyOpenApiDocumentIsInvariant test.

@baywet
Copy link
Contributor Author

baywet commented Feb 18, 2026

@halter73 some auto-formatting got in the way, we should be good now

@halter73
Copy link
Member

halter73 commented Feb 19, 2026

@baywet @martincostello What do you both think about getting this into preview 2? That should release in less than a month. Or we could wait until Preview 3 in mid-April. I'm fine either way. I'd lean to getting breaking changes out ASAP, but I don't want to rush you.

Edit: I assume getting this out early will be mostly fine given we haven't changed the default spec version.

@halter73 halter73 merged commit 5ad0444 into dotnet:main Feb 19, 2026
12 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 11.0-preview2 milestone Feb 19, 2026
@halter73
Copy link
Member

/backport to release/11.0-preview2

@github-actions
Copy link
Contributor

Started backporting to release/11.0-preview2 (link to workflow run)

@baywet
Copy link
Contributor Author

baywet commented Feb 19, 2026

To reiterate what I said on teams for others to read: the earlier the better, it gives more time for our partners to coordinate a release on their end and for us to switch the default version with confidence later on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc community-contribution Indicates that the PR has been added by a community member feature-openapi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAPI 3.2.0 just released

4 participants